package com.ysy.factory;

import com.ysy.api.UserFeignApi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignFallbackFactory implements FallbackFactory<UserFeignApi> {

    private static final Logger log = LoggerFactory.getLogger(UserFeignFallbackFactory.class);

    @Override
    public UserFeignApi create(Throwable cause) {
        log.error("用户服务调用失败:{}", cause.getMessage());
        // TODO 返回定义
        return null;
    }
}
